from core.support import set_cutscene
from core.item import Item
from core.action import Action

class kahlua(Item):
    def __init__(self):
        Item.__init__(self, "kahlua")    # do basic initialization for every item
        self.has_kahlua = True
        # build list of actions
        self.add_action(usekahlua)
    
    def get_description(self):
        return "Kahlua"

# define actions for this item

class usekahlua(Action):
    def __init__(self):
        Action.__init__(self, "usekahlua")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Use Kahlua"
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "post"
    
    # only works in basement. add cutscene
    def do_action(self,game,room,request):
        if room.get_id() == 'sea8hearhelo': 
            set_cutscene("Why wont this light, NOOOOOOO!")
            game.player.pop_item('kaluha')
        else:
            set_cutscene("Now seems as good a time as any")
            game.player.pop_item('kaluha')
        return